//
//  emoticonButton.swift
//  02.表情键盘
//
//  Created by yaochunlin on 16/4/25.
//  Copyright © 2016年 yaochunlin. All rights reserved.
//

import UIKit

class emoticonButton: UIButton {

    var emoticon:YCLEmoticonModel? {
    
        didSet {
        
            if emoticon?.emoji != nil {
                
                self.setTitle(emoticon?.emoji, forState: UIControlState.Normal)
                self.setImage(nil, forState: UIControlState.Normal)
            }else{
            
                self.setImage(UIImage.init(named: (emoticon?.pngPath)!), forState: UIControlState.Normal)
                //防止复用
                self.setTitle(nil, forState: UIControlState.Normal)
            }
        }
    }
   
}
